import { Component, OnInit } from '@angular/core';
import { PermissionEnum } from 'src/app/domain/sparrow';

@Component({
  selector: 'app-permission-select',
  templateUrl: './permission-select.component.html',
  styleUrls: ['./permission-select.component.css']
})
export class PermissionSelectComponent implements OnInit {

  constructor() { }

  ngOnInit(): void {
    this.listOfOption = this.permissionKeys
  }

  permissionKeys: any[] = Object.keys(PermissionEnum).map((label)=> ({label: PermissionEnum[label as keyof typeof PermissionEnum], value: label}));
  listOfSelectedPermissionValue: any[] = [];
  listOfOption?: any[]
  radioValue?: string;

  isNotSelected(value: string): boolean {
    // console.log("selected permission", this.listOfSelectedValue)
    return this.listOfSelectedPermissionValue.indexOf(value) === -1;
  }



}
